package cn.gs;

import cn.gs.entity.User;
import cn.gs.service.UserServiceImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class Application {

    public static void main(String[] args) {
        ApplicationContext context =
                new ClassPathXmlApplicationContext("aspects.xml", "daos.xml", "services.xml");

        UserServiceImpl userService = context.getBean("userService", UserServiceImpl.class);

        List<User> users = userService.findUserList();

        users.forEach(a->System.out.println(a.getName()+","+a.getAge()));
    }
}
